package xyz.awesomeman.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import xyz.awesomeman.entity.User;
import xyz.awesomeman.mapper.UserMapper;

@Service
public class UserServiceImpl implements UserService {
//	使用 JdbcTemplate
	@Autowired
	JdbcTemplate jdbcTemplate;
	@Autowired
	UserMapper userMapper;
	public void addUser(String username, String password) {
		jdbcTemplate.update("insert into user(username,password) values(?,?)",username,password);
	}
	@Override
	public User findById(Integer id) {
		// TODO Auto-generated method stub
		return userMapper.findById(id);
	}

}
